import tensorflow as tf
print(tf.__version__)

#  使用tf.keras 实现简单线性回归
import pandas as pd
data = pd.read_csv("../dataset/Income.csv")
print(data)
x = data.Education
y = data.Income
model = tf.keras.models.Sequential()

model.add(tf.keras.layers.Dense(1, input_shape=(1,)))
print(model.summary())
model.compile(optimizer='adam',
              loss='mse')
model.fit(x, y, epochs=5000)
print(
model.predict(x)
)
print(
    model.predict(pd.Series([20]))
)
